package com.intel;

public class CacheLineDemo2 {
    public volatile static long[] arr = new long[64];

    public static void main(String[] args) throws Exception {
        Thread t1 = new Thread(()->{
            for(long i=0;i<1000_1000_00;++i){
                arr[0] = i;
            }
        });

        Thread t2 = new Thread(()->{
            for(long i=0;i<1000_1000_00;++i){
                arr[8] = i;
            }
        });

        long start = System.nanoTime();

        t1.start();
        t2.start();;
        t1.join();
        t2.join();;

        System.out.println((System.nanoTime() - start)/100_0000);
    }
}
